//- Copyrgith (c) 2015,2016 Lucky Byte, Inc.
//-
extends layout

append css
  style(type="text/css").
    body {
        background-color: #DADADA;
        background-image:url('/img/login_bg.jpg');
        background-repeat: no-repeat;
        background-size: cover;
    }
    body > .grid {
        height: 100%;
    }
    .image {
        margin-top: -100px;
    }
    .column {
        max-width: 450px;
    }

append scripts
  script(src="/js/login.js")

block page
  .ui.middle.aligned.center.aligned.grid
    .column
      if echo_title || echo_message
        .ui.error.message#echo_message
          i.close.icon#echo_close
          if echo_title
            .header(style="text-align:left;")= echo_title
          if echo_message
            p(style="text-align:left;")= echo_message

      form.ui.large.form(action="/login" method="post")
        .ui.stacked.segment
          if locked
            a(href="/login"
              style="float:right; font-size:small; margin-bottom: 4px;")
              | 使用其他用户登录
          .field
            .ui.left.icon.input
              i.user.icon
              input(type="text" name="username" placeholder="登录名")
          .field
            .ui.left.icon.input
              i.lock.icon
              input(type="password" name="password" placeholder="登录密码")
          .ui.buttons.fluid
            if locked
              .ui.large.submit.button.blue.disabled(
                data-locked='true' data-wait-time="#{wait_time}") 已锁定
            else
              - var color = retry_cnt == 2 ? 'orange' : retry_cnt == 1 ? 'red' : 'blue'
              .ui.large.submit.button(class="#{color}") 登 录

      .ui.warning.message
        div 忘记密码？请联系管理员或联系技术支持
          a(href="mailto:service@lucky-byte.com")
            i.icon.mail.outline
      p(style="color: #aaa; font-size: small;")
        | &copy 2015-2016 诺百通讯，版权所有，未经许可属非法使用
